package com.fulihui.information.api;

import com.fulihui.information.dto.ContentListItemDTO;
import com.fulihui.information.request.IsStarQueryRequest;
import com.fulihui.information.request.UserStarQueryPageRequest;
import com.fulihui.information.request.UserStarRequest;
import org.near.servicesupport.result.BaseResult;
import org.near.servicesupport.result.TPageResult;
import org.near.servicesupport.result.TSingleResult;

/**
 * 用户收藏资讯服务
 *
 * @author Willard.Hu on 2017/1/5 0005.
 */
public interface StarService {

    /**
     * 用户收藏资讯
     *
     * @param request {@link UserStarRequest}
     * @return {@link BaseResult}
     */
    BaseResult star(UserStarRequest request);

    /**
     * 用户取消收藏资讯
     *
     * @param request {@link UserStarRequest}
     * @return {@link BaseResult}
     */
    BaseResult unstar(UserStarRequest request);

    /**
     * 用户关注的分页列表，用户关注行为与用户看关注列表行为互斥，因此无需对分页做特殊处理
     *
     * @param request {@link UserStarQueryPageRequest}
     * @return {@link ContentListItemDTO} 列表
     */
    TPageResult<ContentListItemDTO> userStars(UserStarQueryPageRequest request);

    /**
     * 判断用户是否关注指定资讯内容
     *
     * @param request {@link IsStarQueryRequest}
     * @return 返回是否关注 true/false
     */
    TSingleResult<Boolean> isStar(IsStarQueryRequest request);
}
